package com.tsmti.system.entity;

import com.tsmti.core.common.entity.BaseDataEntity;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.Date;

/**
 * @Package：com.tsmti.system.entity
 * @Class：UserLastOnline
 * @Description： 最后登陆用户
 * @Author：zcw
 * @Date：Created in 2018/1/30 18:12
 * @Company:
 * @Version：
 * @Modified By:
 */
@Entity
@Table(name = "pims_user_lastonline")
@DynamicUpdate
@DynamicInsert
@SuppressWarnings("serial")
@Where(clause = "delFlag = 0")
public class UserLastOnline extends BaseDataEntity<Long> {

    private Long id;

    private Long loginCount;

    private Long totalOnlineTime;

    private String host;

    private String userAgent;

    private String systemHost;

    private String username;

    private Date lastStopTimestamp;

    private Date lastLoginTimestamp;

    private Long userId;

    /**
     * 获取 id
     *
     * @return: Long id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_USERLASTONLINE")
    @SequenceGenerator(name = "SEQ_USERLASTONLINE", sequenceName = "userlastonline_sequence", allocationSize = 1)
    @Override
    public Long getId() {
        return this.id;
    }

    /**
     * 设置 id
     * @param: id
     */
    @Override
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 获取 loginCount
     *
     * @return: Long login_count
     */

    public Long getLoginCount() {
        return this.loginCount;
    }

    /**
     * 设置 loginCount
     *
     * @param: loginCount
     *             login_count
     */
    public void setLoginCount(Long loginCount) {
        this.loginCount = loginCount;
    }

    /**
     * 获取 totalOnlineTime
     *
     * @return: Long total_online_time
     */
    public Long getTotalOnlineTime() {
        return this.totalOnlineTime;
    }

    /**
     * 设置 totalOnlineTime
     *
     * @param: totalOnlineTime
     *             total_online_time
     */
    public void setTotalOnlineTime(Long totalOnlineTime) {
        this.totalOnlineTime = totalOnlineTime;
    }

    /**
     * 获取 host
     *
     * @return: String host
     */
    public String getHost() {
        return this.host;
    }

    /**
     * 设置 host
     *
     * @param: host
     *             host
     */
    public void setHost(String host) {
        this.host = host;
    }

    /**
     * 获取 userAgent
     *
     * @return: String user_agent
     */
    public String getUserAgent() {
        return this.userAgent;
    }

    /**
     * 设置 userAgent
     *
     * @param: userAgent
     *             user_agent
     */
    public void setUserAgent(String userAgent) {
        this.userAgent = userAgent;
    }

    /**
     * 获取 systemHost
     *
     * @return: String system_host
     */
    public String getSystemHost() {
        return this.systemHost;
    }

    /**
     * 设置 systemHost
     *
     * @param: systemHost
     *             system_host
     */
    public void setSystemHost(String systemHost) {
        this.systemHost = systemHost;
    }

    /**
     * 获取 username
     *
     * @return: String username
     */
    public String getUsername() {
        return this.username;
    }

    /**
     * 设置 username
     *
     * @param: username
     *             username
     */
    public void setUsername(String username) {
        this.username = username;
    }

    /**
     * 获取 lastStopTimestamp
     *
     * @return: Date last_stop_timestamp
     */
    public Date getLastStopTimestamp() {
        return this.lastStopTimestamp;
    }

    /**
     * 设置 lastStopTimestamp
     *
     * @param: lastStopTimestamp
     *             last_stop_timestamp
     */
    public void setLastStopTimestamp(Date lastStopTimestamp) {
        this.lastStopTimestamp = lastStopTimestamp;
    }

    /**
     * 获取 lastLoginTimestamp
     *
     * @return: Date last_login_timestamp
     */
    public Date getLastLoginTimestamp() {
        return this.lastLoginTimestamp;
    }

    /**
     * 设置 lastLoginTimestamp
     *
     * @param: lastLoginTimestamp
     *             last_login_timestamp
     */
    public void setLastLoginTimestamp(Date lastLoginTimestamp) {
        this.lastLoginTimestamp = lastLoginTimestamp;
    }


    /**
     * 获取 userId
     *
     * @return: Long user_id
     */
    public Long getUserId() {
        return this.userId;
    }

    /**
     * 设置 userId
     *
     * @param: userId
     *             user_id
     */
    public void setUserId(Long userId) {
        this.userId = userId;
    }

}
